#include <algorithm>
#include <cstdio>
#include <tuple>
#include <vector>
constexpr int MaxN = 1e5 + 5;
int n, m, k;
int fa[MaxN];
int depth[MaxN];
bool vis[MaxN];
bool imp[MaxN];
std::vector<int> g[MaxN];
std::vector<std::tuple<int, int>> ad;
int dfs(int u, int f)
{
    if (vis[u]) {
        return -1;
    }
    fa[u] = f;
    vis[u] = true;
    depth[u] = depth[f] + 1;
    int last = imp[u] ? u : -1;
    for (const auto& v : g[u]) {
        if (v == f) {
            continue;
        }
        int d = dfs(v, u);
        if (d != -1) {
            if (last != -1) {
                ad.push_back({ d, last });
                last = -1;
            } else {
                last = d;
            }
        }
    }
    return last;
}
std::vector<int> way(int u, int v)
{
    std::vector<int> a, b;
    if (depth[u] < depth[v]) {
        std::swap(u, v);
    }
    for (; depth[u] > depth[v];) {
        a.push_back(u);
        u = fa[u];
    }
    for (; u != v;) {
        a.push_back(u);
        u = fa[u];
        b.push_back(v);
        v = fa[v];
    }
    if (u == v) {
        a.push_back(u);
    }
    std::reverse(b.begin(), b.end());
    a.insert(a.end(), b.begin(), b.end());
    return a;
}
int main()
{
    freopen("travel.in", "r", stdin);
    freopen("travel.out", "w", stdout);
    scanf("%d%d%d", &n, &m, &k);
    for (int i = 1; i <= m; i++) {
        int u, v;
        scanf("%d%d", &u, &v);
        g[u].push_back(v);
        g[v].push_back(u);
    }
    for (int i = 1; i <= k; i++) {
        int u;
        scanf("%d", &u);
        imp[u] = true;
    }
    for (int i = 1; i <= n; i++) {
        if (vis[i]) {
            continue;
        }
        dfs(i, 0);
    }
    printf("%d\n", int(ad.size()));
    for (const auto& [u, v] : ad) {
        const auto& w = way(u, v);
        printf("%d", int(w.size()));
        for (const auto& val : w) {
            printf(" %d", val);
        }
        printf("\n");
    }
    return 0;
}